<div xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:py="http://genshi.edgewall.org/"
      >
      	
<script type="text/javascript" language="javascript" src="${href.chrome('sp', 'js', 'jquery.tablednd_0_5.js')}"></script>		
		
<script type="text/javascript" language="javascript">
$(function() {	
    $("#testConditionBtn").data('ajax_url', "${href.sqa('ws_reg')}");
    $('body').data('ws_ticket_form_url', "${href.sqa('ws_ticket_form')}")
	$('body').data('admin_edit', "${href.sqa('ws_admin_form')}")

	$('#JS').text("${href.chrome('sp', 'js', 'jquery.tablednd_0_5.js')} , ${href.sqa()}")
	// add hover editor inside of administration tab only.
	$("#testAdminDiv tr.hover").hover(
		function() {
			// TODO change this to a div html re-write under the step number instead of an append to the end of the row
			//$('.adminHeader').show();
			
			var isEdited = $(this).attr('edited')
			if (isEdited == 'true') {
				$(this).find(".editOpts").html($('<td colspan="20" class="edit"><div id="_Insert"  class="testPlanLink">Insert</div><div id="_Append" class="testPlanLink">Append</div><div id="_Delete" class="testPlanLink"> Delete</div>	</td>'));
			} else if (isEdited == 'delete') {
				$(this).find(".editOpts").html($('<td colspan="20" class="edit"><div id="_Insert"  class="testPlanLink">Insert</div><div id="_Append" class="testPlanLink">Append</div>	</td>'));
			/*
			} else if (isEdited == 'append') {
				// remove append option
				$(this).find(".editOpts").html($('<td colspan="20" class="edit"><div id="_Insert"  class="testPlanLink">Insert</div><div id="_Delete" class="testPlanLink"> Delete</div>	</td>'));
			} else if (isEdited == 'insert') {
				// remove insert option
				$(this).find(".editOpts").html($('<td colspan="20" class="edit"><div id="_Append" class="testPlanLink">Append</div><div id="_Delete" class="testPlanLink"> Delete</div>	</td>'));
			*/
			} else {
				$(this).find(".editOpts").html($('<td colspan="20" class="edit"> <div id="_Edit" class="testPlanLink "> Edit</div><div id="_Insert"  class="testPlanLink">Insert</div><div id="_Append" class="testPlanLink">Append</div><div id="_Delete" class="testPlanLink"> Delete</div>	</td>'));
			}
		},
		function() {
	
			$(this).find(".edit").remove();	
			//$('.adminHeader').hide();
		}
	);
	
	//$('.adminStepEditList')
	
	$("#testAdminDiv tr#adminLastRow").show();


	
});
</script>
		<div id="JS"></div>
 		<table class="listing" id="${type}_tbl">
        <thead>
          <tr>
			<th width="75px">Order</th><th class="hidden tp_exec" >Test Result</th><th width="50%">Testing Activity</th><th width="50%">Expected Result</th>
		  </tr>
        </thead>
		
		<tr py:for="step in case" id="${step.case_id}" class="hover adminStepEditList">
		
		
		<td width="10px" >
			<div class="stepNum">${step.test_order}</div>
			<div class="editOpts"></div>
			

		</td>
		<td class="hidden tp_exec" width="10px" >
		  	<input type="button" id="step_pass" class="passfail_btn" name="${step.case_id}" value="pass" reg_num="${reg}"  />
		  	<input type="button" id="step_fail" class="passfail_btn pflast fail_btn" name="${step.case_id}" value="fail" reg_num="${reg}" step_num="${step.test_order}"/>
	  	</td>
		<td id="${type}_procedure_${step.case_id}">	
			<div id="_namegrp">
				 <label id="_namelbl">${step.item_name}</label>
			</div>
			 <div id="_proceduregrp">
				 <label id="_lbl">Test Procedure</label>
			 </div>
			 <div>
			 	${step.test_procedure}
			 </div>
		</td>
		<td id="${type}_expResult_${step.case_id}">
			${step.expected_result}
		</td>
        </tr>
		<tr id="adminLastRow" class="editHover hidden">
			<td>New Item
			<input type="button" class="editSave" id="" name="editAction" value="Update"/>
			</td>
			<td><textarea name="procedure" class="stepProcedure adminEditor wikitext"></textarea></td>
			<td><textarea name="expResult" class="expResult adminEditor wikitext"></textarea></td>		
		</tr>
      </table>
 	
    	
		
</div>
